﻿/*----------------------------------------------------------------
    // Copyright (C) 2009 江苏华招网
    // 版权所有。 
    // 作者：庄金冬 
    //
    // 文件名：IBLL_Hospital.cs
    // 文件功能描述：医疗机构接口
    // 创建标识：庄金冬2009-03-06
    //
    // 修改标识：
    // 修改描述：
    //
    // 修改标识：
    // 修改描述：
    //
    // 审核人：
    // 审核时间：
    // 审核说明：
 //----------------------------------------------------------------*/
using System;
using System.Collections.Generic;

using System.Text;
using HZ.DrugTrade.Model;

namespace HZ.DrugTrade.IBLL
{
    /// <summary>
    /// 医疗机构接口
    /// </summary>
    public interface IBLL_Hospital
    {

        /// <summary>
        /// 获取最新可用医疗机构编号
        /// </summary>
        /// <returns>最新可用医疗机构编号</returns>
        string GetNewHospitalID();

        /// <summary>
        /// 获取所有医疗机构
        /// </summary>
        /// <returns>所有医疗机构</returns>
        IList<Hospital> GetAllHospital();

        /// <summary>
        /// 获取所有未注册医疗机构
        /// </summary>
        /// <returns>所有未注册医疗机构</returns>
        IList<Hospital> GetAllUnregHospital();

        /// <summary>
        /// 编辑医疗机构
        /// </summary>
        /// <returns>True:成功;False:失败</returns>
        bool UpdateHospital(Hospital hospital);


        /// <summary>
        /// 删除医疗机构
        /// </summary>
        /// <param name="hospital">医疗机构</param>
        /// <returns>0.删除失败;1.删除成功;2.已被使用不能删除;</returns>
        int DeleteHospital(Hospital hospital);
        /// <summary>
        /// 物理删除医疗机构
        /// </summary>
        /// <param name="HospitalID">医疗机构ID</param>
        /// <param name="type">删除类型 1 采购信息 2 删除采购目录信息 3 删除医疗机构及权限</param>
        /// <returns></returns>
        int Delete_physicsHospital(String HospitalID, string type);
        /// <summary>
        /// 添加医疗机构
        /// </summary>
        /// <param name="hospital">医疗机构</param>
        /// <returns>0.添加失败;1.添加成功;2.已经存在;</returns>
        int AddHospital(Hospital hospital);

        /// <summary>
        /// 条件查询医疗机构
        /// </summary>
        /// <param name="hospital">查询用实体</param>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">每页显示记录数</param>
        /// <param name="totalRecord">（输出参数）总记录数目</param>
        /// <returns></returns>
        IList<HZ.DrugTrade.Model.Hospital> GetHospitalByWhere(HZ.DrugTrade.Model.Query.Hospital hospital, int currentPage, int pageSize, out int totalRecord);

        /// <summary>
        /// 自助注册一个新医疗机构信息
        /// </summary>
        /// <param name="companyinfo"></param>
        /// <returns></returns>
        int RegNewHospital(Model.HospitalInfo hospitalinfo);


        /// <summary>
        /// 自助注册一个新医疗机构信息
        /// </summary>
        /// <param name="companyinfo"></param>
        /// <returns></returns>
        int RegNewHospital(Hospital hospital,Model.HospitalInfo hospitalinfo);


        /// <summary>
        /// 将系统帐户与医疗机构信息进行关联
        /// </summary>
        /// <param name="companyinfo"></param>
        /// <param name="?"></param>
        /// <returns></returns>
        int MarkLinkToHospitalInfo(Model.HospitalInfo hospitalinfo, Model.Hospital hospital);
        /// <summary>
        /// 审核医疗机构
        /// </summary>
        /// <param name="hospitalinfo"></param>
        /// <returns></returns>
        // Hospital AuditHospital(Model.HospitalInfo hospitalinfo);
        /// <summary>
        /// 获取注册医疗机构信息
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        IList<Model.HospitalInfo> GetRegedHospitalInfo(Model.Query.HospitalInfo where, int currentpage, int pagesize, out int totalrecord);
        /// <summary>
        /// 获取未注册授权的医疗机构列表
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        IList<Model.HospitalInfo> GetUnregedHopialInfo(Model.Query.HospitalInfo where, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 批量审核医疗机构
        /// </summary>
        /// <param name="hospitallist"></param>
        /// <returns></returns>
        int AuditHospital(IList<Model.HospitalInfo> hospitallist);

        /// <summary>
        /// 删除不需要的医疗机构列表
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        int DeleteHospitalInfo(IList<Model.HospitalInfo> list);

        /// <summary>
        /// 更新医疗机构信息
        /// </summary>
        /// <param name="hospitalinfo">医疗机构名ID等不能空</param>
        /// <param name="hospital">>医疗机构名ID等不能空</param>
        /// <returns></returns>
        int UpdateHospitalInfo(Model.HospitalInfo hospitalinfo, Model.Hospital hospital);

        /// <summary>
        /// 更新医疗机构信息
        /// </summary>
        /// <param name="hospitalinfo">医疗机构名ID等不能空</param>
        /// <param name="hospital">>医疗机构名ID等不能空</param>
        /// <returns></returns>
        int UpdateHospitalInfo2(Model.HospitalInfo hospitalinfo, Model.Hospital hospital, bool updateHospitalName);

        /// <summary>
        /// 根据医疗机构ID获取医疗机构其它信息
        /// </summary>
        /// <param name="companyid"></param>
        /// <returns></returns>
        HospitalInfo GetHospitalInfoByID(string hospitalid);
        /// <summary>
        /// 获取所有医疗机构等级详细
        /// </summary>
        /// <returns></returns>
        List<string> GetHospitalinfoLevelDetail();
        /// <summary>
        /// 获取所有医疗机构等级
        /// </summary>
        /// <returns></returns>
        List<string> GetHospitalinfoLevels();


        /// <summary>
        /// 根据医疗机构等级获取医疗机构ID
        /// </summary>
        /// <param name="LevelDetail"></param>
        /// <returns></returns>
        string GetHospitalIDByLevelDetail(string LevelDetail);

        IList<Model.HospitalInfo> GetAllHopialInfo(Model.Query.HospitalInfo where, int currentpage, int pagesize, out int totalrecord);

        System.Data.DataTable GetAllHopialInfo2(Model.Query.HospitalInfo where, int currentpage, int pagesize, out int totalrecord);

        IList<Model.HospitalInfo> GetAllUnInitializeHopialInfo(string where, int currentpage, int pagesize, out int totalrecord);
    }
}
